<template>
  <div>
    <el-table
      :data="dataArr"
      highlight-current-row
      :default-sort="{prop: 'createTime', order: 'descending'}"
      @current-change="handleCurrentChange"
      :show-overflow-tooltip="true"
    >
      <el-table-column type="selection">
      </el-table-column>
      <el-table-column type="index">
      </el-table-column>
      <template v-for="(col, index) in colHeadArr">
        <el-table-column
          :prop="col.value"
          :label="col.label"
          :sortable="col.value === 'createTime' || col.value === 'updateTime'"
        ></el-table-column>
      </template>
      <el-table-column
        prop="ops"
        label="操作"
        fixed="right"
      >
        <template slot-scope="col">
          <manage-button
            type='primary'
            :icon="'el-icon-edit'"
            :perms="'sys:user:edit'"
          ></manage-button>
          <manage-button :icon="'el-icon-delete'" :perms="'sys:user:del'"></manage-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage4"
      :page-sizes="[100, 200, 300, 400]"
      :page-size="100"
      layout="total, sizes, prev, pager, next, jumper"
      :total="400">
    </el-pagination>
  </div>
</template>
<style lang="less" scoped>
</style>
<script>
export default {
  model: {},
  components: {
    ManageButton: () => import("./ManageButton")
  },
  props: {
    dataArr: Array,
    colHeadArr: Array,
    permsArr: Array
  },
  data() {
    return {
      currentRow: null,
      currentPage4: 1
    };
  },
  methods: {
    handleCurrentChange(row) {
      this.currentRow = row;
    },
    handleSizeChange() {

    },
  }
};
</script>
